from .check import is_collection_type, is_inbuilt_single_type, is_inbuilt_type


def get_all_annotations(obj):
    """
    获取对象及其父类的所有注解
    """
    annotations = {}
    # 获取对象的所有基类（包括对象本身）的继承顺序
    for base in obj.__class__.__mro__:
        annotations.update(base.__dict__.get("__annotations__", {}))
    return annotations


def get_dimension(lst):
    """
    获取列表的维度
    """
    if isinstance(lst, list) and lst:
        return 1 + get_dimension(lst[0])
    return 0
